<template>
  <div>
    <el-table border :data="tableData">
      <template v-for="colConfig in colConfigs">
        <!--slot 作为占位符 用来放置按钮-->
        <slot v-if="colConfig.slot" :name="colConfig.slot"></slot>
        <!--v-bind="{prop: 'code',label: 'name'}"-->
        <el-table-column align="center" v-else v-bind="colConfig" :key="colConfig.id" />
      </template>  
    </el-table>
    <!-- <el-pagination
      background
      style="margin-top:15px;"
      layout="total, sizes, prev, pager, next, jumper"
      :current-page.sync="form.pageNum"
      :page-sizes="[10, 20, 30, 50]"
      :page-size="form.pageSize"
      @size-change="handleSizeChange"
      @current-change="handleCurrentChange"
      :total="form.total">
    </el-pagination> -->
  </div>
</template>

<script>
export default {
  props: {colConfigs: Array, tableData: Array,form: Object},
  data() {
    return {

    }
  },
  methods: {
    handleSizeChange(val){
      this.form.pageSize = val;
      this.list()
    },
    handleCurrentChange(val) {
      this.form.pageNum = val;
      this.list();
    }
  },
  created() {

  }
}
</script>